<template>
	<view class="mainpadding2" style="padding-bottom: 150rpx;">
		<!-- type:1,//身份:1=主办方,2=俱乐部,3=团队，4场地，5教练 -->
		<view class="mainpadding_top ffffff" v-for="item in list.data" :key="item.id" @click="jumpdetail(item)">
			<view class="flexbetween">
				<view class="titletext hei_text bold">{{item.name}}</view>
				<view class="strongtext xiaolv bold">{{returnName(item.type)}}</view>
			</view>
			<view class="margin_top	strongtext xiaohuang" v-if="item.status==1">审核中</view>
			<view class="margin_top strongtext xiaolv" v-if="item.status==2 && item.cancel_status==1">审核成功</view>
			<view class="margin_top strongtext xiaohong" v-if="item.status==2 && item.cancel_status==2">平台取消合作</view>
			<view class="margin_top strongtext xiaohong" v-if="item.status==3">审核失败</view>
		</view>
		<view class="gudingdb mainpadding">
			<view class="bigbtn" @click="jumper('/pages_mypage/woyaohezuo')">我要合作</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				list:{
					data:[]
				},
				type:""
			}
		},
		onLoad(options) {
			if(options.type){
				this.type = options.type
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			returnName(val){
				// 	type:1,//身份:1=主办方,2=俱乐部,3=团队，4场地，5教练
				if(val==1) return "主办方"
				if(val==2) return "俱乐部"
				if(val==3) return "团队"
				if(val==4) return "场地"
				if(val==5) return "教练"
			},
			init(){
				httpRequest.request("/api/user/myUserZbfapply", 'GET', {
					type:this.type
				}).then(res => {
					this.list = res.data
				})
			},
			jumpdetail(item){
				if(this.type){
					uni.$emit('checksf',item)
					uni.navigateBack(1)
					return false
				}
				if (item.status==2) {
					uni.navigateTo({
						url: "/pages_mypage/hezuogl?type="+item.type+"&user_zbfapply_listid="+item.id+"&cancel_status="+item.cancel_status
					})
				}else{
					uni.navigateTo({
						url: "/pages_mypage/hezuosh?id="+item.id
					})
				}
			},
			jumper(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style>

</style>
